<?php

include_once BONE_ROOT.DS.APP_DIR.DS.'templates'.DS.'technic'.DS.'technic.php';

class template_edit extends template_technic
{

	protected function head()
	{
		$this->load_editor();
	}

	protected function center()
	{
		$technic = $this->get('technic');
		$categories = $this->get('categories');
		
		$this->toolbar();
		?>

<div class="box">
	<div class="box-tl"><div class="box-tr"><div class="box-tm"></div></div></div>	
	<div class="box-m">
		
		<h3 class="title"><?php echo $this->get_title(); ?></h3>
		<form action="./" method="post" enctype="multipart/form-data">
		<table class="edit-table">
		<tbody>
		<tr>
		<td class="key">标题</td>
		<td><input type="text" name="title" value="<?php echo $technic->title; ?>" style="width:500px;" /></td>
		</tr>
		<tr>
		<td class="key">所属分类</td>
		<td>
		<select name="category_id">
		<?php 
		foreach($categories as $category)
		{
			echo '<option value="'.$category->id.'"';
			if($category->id == $technic->category_id) echo ' selected';
			echo '> - '.$category->name.' - </option>';
		}
		?>
		</select>
		</td>
		</tr>

		<tr>
		<td class="key">内容</td>
		<td><?php $this->editor('description', $technic->description, '600px', '400px'); ?></td>
		</tr>
		
		<tr>
		<td class="key">摘要</td>
		<td><textarea name="summary" style="width:500px; height:60px;"><?php echo $technic->summary; ?></textarea></td>
		</tr>
		
		<tr>
		<td class="key">关健词</td>
		<td><textarea name="keyword" style="width:500px; height:60px;"><?php echo $technic->keyword; ?></textarea></td>
		</tr>
		
		<tr>
		<td class="key">示例网址</td>
		<td><input type="text" name="demo" value="<?php echo $technic->demo; ?>" /></td>
		</tr>
		
		<tr>
		<td class="key">点击量</td>
		<td><input type="text" name="hits" value="<?php echo $technic->hits; ?>" /></td>
		</tr>

	
		<tr>
		<td class="key"></td>
		<td>
		<input class="btn" type="submit" value="保存" /> <input class="btn" type="button" value="返回" onclick="javascript:window.history.go(-1);" />
		</td>
		</tr>
		</tbody>
		</table>
		<input type="hidden" name="id" value="<?php echo $technic->id; ?>" />
		<input type="hidden" name="controller" value="technic" />
		<input type="hidden" name="task" value="edit_save" />
		</form>
	</div>
	<div class="box-bl"><div class="box-br"><div class="box-bm"></div></div></div>
</div>
		

		<?php
		
	}	

}
?>